The previous patches removed a number of conffiles that weren't necessary,
meaning we can now assume that any changes or additional files in /etc/bind
are things that the user wants to keep.
Since /var/lib/bind is the standard location for longer-lived zone data
(i.e. not zones that secondary servers have obtained via XFER), we symlink
it to /etc/bind/zones so that it survives a sysupgrade.
Temporary files (such as XFER:ed zones for secondaries) stay in
/var/cache/bind.
Signed-off-by: David Härdeman <[email protected]>
endef
define Package/bind-server/conffiles
-/etc/bind/db.root
-/etc/bind/named.conf
+/etc/bind
endef
define Package/bind-server-filter-aaaa/install
// This is the primary configuration file for the BIND DNS server named.
options {
+ // Default directory for ephemeral zones, long-lived zones
+ // can be stored under /var/lib/bind (aka /etc/bind/zones)
directory "/var/cache/bind";
};
run_dir=/var/run/named
log_dir=/var/log/named
cache_dir=/var/cache/bind
+zone_dir=$config_dir/zones
lib_dir=/var/lib/bind
-dyn_dir=/tmp/bind
config_file=$config_dir/named.conf
config_local_file=$dyn_dir/named.conf.local
user_exists bind 57 || user_add bind 57
group_exists bind 57 || group_add bind 57
- for dir in $run_dir $log_dir $cache_dir $lib_dir $dyn_dir; do
+ for dir in $run_dir $log_dir $cache_dir $zone_dir; do
if [ ! -e "$dir" ]; then
mkdir -p "$dir"
fi
chmod 0775 "$dir"
done
+ if [ ! -e $lib_dir ]; then
+ mkdir -p $(dirname $lib_dir)
+ ln -sf $zone_dir $lib_dir
+ fi
+
if [ ! -s /etc/bind/rndc.key ] && [ ! -s /etc/bind/rndc.conf ]; then
rndc-confgen -a
chown bind:bind /etc/bind/rndc.key